
package net.qiqbframework.serialization.converters;

import net.qiqbframework.serialization.ContentTypeConverter;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

public class ByteArrayToInputStreamConverter implements ContentTypeConverter<byte[], InputStream> {

    @Override
    public Class<byte[]> expectedSourceType() {
        return byte[].class;
    }

    @Override
    public Class<InputStream> targetType() {
        return InputStream.class;
    }

    @Override
    public InputStream convert(byte[] original) {
        return new ByteArrayInputStream(original);
    }
}
